import http from '@/utils/request.js'

export default {
add: (obj) => {
        return http({
            url: '/api/address/addAddress',
            method: 'post',
            data: obj,
                headers: {
                    //定义将数据以json的形式传入后台(java)
                    'Content-Type': 'application/json'
                }
        }
        )
 },
list: () => {
        return http({
            url: '/api/address/addressList',
            method: 'get'
        }
        )
 },
    address: () => {
        return http({
            url: '/api/address/getAddress',
            method: 'get',
        }
        )
 },
    edit:( obj)=> {
        return http({
            url: '/api/address/editAddress',
            method: 'put',
            data: obj,
            headers: {
                //定义将数据以json的形式传入后台(java)
                'Content-Type': 'application/json'
            }
        });
    },
    delete:(id) => {
        return http({
            url: `/api/address/deleteAddress/${id}`,
            method: 'delete',
        });
    },

}